import { lazy } from "react";
import { createBrowserRouter } from 'react-router-dom'

const Home = lazy(() => import('../pages/Home/index'))
const Index = lazy(() => import('../pages/Index/index'))
const Order = lazy(() => import('../pages/Order/index'))
const App = lazy(() => import('../App'))

export const Zi = [
    {
        path: '/home/index',
        element: <Index></Index>,
        title: '首页'
    },
    {
        path: '/home/order',
        element: <Order></Order>,
        title: '订单'
    },
]

const routes = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: [
            {
                path: '/home',
                element: <Home></Home>,
                children: Zi

            }
        ]
    }
])

export default routes